package com.abuaziz.librarys.tset_adapter

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import com.abuaziz.librarys.R
import com.ug_project.adapters.createBaseAdapter
import com.ug_project.adapters.createRecyclerAdapter
import com.ug_project.views.click
import kotlinx.android.synthetic.main.fragment_test_adapter.*
import me.yokeyword.fragmentation.SupportFragment

class TestFragment : SupportFragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        var view = inflater.inflate(R.layout.fragment_test_adapter, container, false)
        return view
    }


    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        recyclerView.layoutManager = LinearLayoutManager(activity)
        recyclerView.adapter = createRecyclerAdapter(R.layout.item_test_adapter,
                arrayListOf("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "")) {

            OnBindViewHolderIData { view, itemViewResID, data, position ->
                view.click {
//                    start(TestFragment() as me.yokeyword.fragmentation.ISupportFragment)
                }
            }

        }

//        var d= createBaseAdapter(context, 0, arrayListOf("")) {
//            filter { it.contains(",") }
//
//            GetViewIData { position, view, parent, data ->  }
//        }

    }
}